/**
 * @param {number} n
 * @return {number}
 */
var hammingWeight = function(n) {
    let ans = 0;
    while ( n>= 1) {
        ans += n & 1;
        n = n >>> 1;
    }
    return ans;
};
var hammingWeight_faster = function(n) {
    let ans = 0;
    while ( n>= 1) {
        n = n & ( n - 1 );
        ans += 1;
    }
    return ans;
};
hammingWeight_faster(11);